<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head th:fragment="head(title)">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title th:replace="${title}">后台公共页面片段</title>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="../static/lib/bootstrap-3.4.1/css/bootstrap.min.css"
          th:href="@{/lib/bootstrap-3.4.1/css/bootstrap.min.css}">
    <link rel="stylesheet" href="../static/css/my.css" th:href="@{/css/my.css}">
    <!-- 动画 -->
    <link rel="stylesheet" href="../static/css/animate.css" th:href="@{/css/animate.css}">
    <!-- 轻型信息提示框-->
    <link rel="stylesheet" th:href="@{/lib/toastr/toastr.min.css}">
    <!-- 下拉列表-->
    <link rel="stylesheet" th:href="@{/lib/bootstrap-select/bootstrap-select.css}">
    <!-- bootstrap-bootstrapValidator-->
    <link rel="stylesheet" th:href="@{/lib/bootstrapValidator/bootstrapValidator.min.css}">
</head>

<body>
<nav th:fragment="menu(n)" class="navbar navbar-default navbar-fixed-top m-padding">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" th:href="@{/admin/index}">
                <img alt="Brand" src="../static/favicon.ico" style="width: 24px;" th:src="@{/favicon.ico}">
            </a>
            <p class="navbar-text navbar-default"><a th:href="@{/admin/index}" class="navbar-link m-a-none"><strong class="logo">后台管理</strong></a></p>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li th:classappend="${n == 1} ? 'active'"><a th:href="@{/admin/index}"><span class="glyphicon glyphicon-home">&nbsp;</span>首页</a></li>
                <li th:classappend="${n == 2} ? 'active'"><a th:href="@{/admin/navigation}"><span class="glyphicon glyphicon-tasks">&nbsp;</span>导航管理</a></li>
                <li th:classappend="${n == 3} ? 'active'"><a th:href="@{/admin/tag}"><span class="glyphicon glyphicon-tag">&nbsp;</span>标签管理</a></li>
                <li th:classappend="${n == 4} ? 'active'"><a th:href="@{/admin/link}"><span class="glyphicon glyphicon-link">&nbsp;</span>链接管理</a></li>
                <li th:classappend="${n == 5} ? 'active'" role="presentation" class="disabled"><a href="#"><span class="glyphicon glyphicon-bookmark">&nbsp;</span>书签管理</a></li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">
                        <img class="m-avatar img-circle"
                             src="../static/images/me.jpg" th:src="@{/images/me.jpg}">
                        挚夕
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-left">
                        <li><a href="#"><span class="glyphicon glyphicon-th">&nbsp;</span>个人主页</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a th:href="@{/admin/logout}"><span class="glyphicon glyphicon-log-out">&nbsp;</span>登出</a></li>
                    </ul>
                </li>
            </ul>


        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<footer th:fragment="footer">
    <div>
        <div class="row">
            <div class="col-xs-12 col-sm-6 col-md-3">
                <h3>挚夕导航</h3>
                <p>
                    挚夕导航最初源于本人想要做一个管理书签的系统。
                    后来借鉴了一些导航网站，决定做一个网站导航。<br>
                </p>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-12" style="text-align: center;">
                Copyright 2023-now 挚夕导航 Designed by 挚夕
            </div>
        </div>
    </div>
</footer>

<th:block th:fragment="script" th:inline="javascript">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script th:src="@{/lib//jquery-1.12.4/jquery.min.js}"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script th:src="@{/lib/bootstrap-3.4.1/js/bootstrap.min.js}"></script>
    <!--  bootstrap-dropdown-hover -->
    <script th:src="@{/lib/bootstrap-dropdown-hover.js}"></script>
    <!--  下拉列表-->
    <script th:src="@{/lib/bootstrap-select/bootstrap-select.js}"></script>
    <script th:src="@{/lib/bootstrap-select/defaults-zh_CN.js}"></script>
    <!--  轻型信息提示框-->
    <script th:src="@{/lib/toastr/toastr.min.js}"></script>
    <!--  警告框的综合解决方案-->
    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    <!-- bootstrap-bootstrapValidator-->
    <script th:src="@{/lib/bootstrapValidator/bootstrapValidator.min.js}"></script>
    <script th:src="@{/lib/bootstrapValidator/zh_CN.js}"></script>
    <script>
        $(function () {
            //bootstrap-dropdown-hover
            $('.navbar [data-toggle="dropdown"]').bootstrapDropdownHover({
                // see next for specifications
            });
            //特效
            $("li").hover(function () {
                $(this).toggleClass("m-up");
            })
            //配置轻型信息提示框
            toastr.options = {
                "closeButton": false, //是否显示关闭按钮
                "showDuration": "300",//显示的动画时间
                "hideDuration": "1000",//消失的动画时间
                "timeOut": "2000", //展现时间
            };
        });
    </script>
</th:block>


</body>

</html>